
struct Program *createProgram(struct StmtList *last);

struct NExpr *createExpr(enum ExprType type);

struct NExpr * createBinaryExpr(enum ExprType type,struct NExpr *left,struct NExpr *right);

struct NExpr * createUnaryExpr(enum ExprType type, struct NExpr *expr);

struct NExpr * createIndArrayExpr(struct NExpr *id, struct NExpr *ind);

struct NExpr * createEmptyIndArrayExpr(struct NExpr *id);

struct NExpr * CreateCallMethodExpr(enum ExprType type,struct NExpr *expr,struct NExprList *expr_list, char *methid,char *methOrField);

struct NExpr * createDoubleColonExpr(char *id,struct NExpr *right);

struct NExpr * createNewExpr(char *className,struct NExprList *expr_list);

struct NExprList *createExprList(struct NExpr *expr);

struct NExprList *addToExprList(struct NExprList *expr_list,struct NExpr *expr);

struct Stmt *CreatePrintStmt(enum StmtType type, struct NExprList *expr_list);

struct Stmt *CreateIfStmt(struct Stmt *expr, struct Stmt *stmt_true, struct Stmt *stmt_false);

struct Stmt *CreateWhileStmt(struct Stmt *expr, struct Stmt *stmt_true);

struct Stmt *CreateForStmt(struct NExpr *expr1, struct NExpr *expr2, struct NExpr *expr3, struct Stmt *stmt_true);

struct StmtList *CreateStmtList(struct Stmt *stm);

struct StmtList *AddToStmtList(struct StmtList *stm_list, struct Stmt *stm);

struct Stmt *CreateExprStmt(struct NExpr *exp);

struct Stmt *CreateReturnStmt(struct NExpr *exp);

struct Stmt *CreateForeachStmt(struct NExpr *exp1, char *key, char *val, struct Stmt *stm);

struct Stmt *CreateFieldDeclStmt(int isStatic, enum AccessRule accessRule, struct NExpr *var, struct NExpr *val);

struct Stmt *CreateFuncDeclStmt(char *id, struct FuncParamList *paramList, struct StmtList *funcBody);

struct FuncParam *CreateFuncParam(struct NExpr *var, struct NExpr *val);

struct FuncParamList *CreateFuncParamList(struct FuncParam* param);

struct FuncParamList *AddToFuncParamList(struct FuncParamList* list, struct FuncParam *param);

struct Stmt* CreateClassDeclStmt(char *class_name, char *parent_name, struct StmtList *stmtList); 

struct Stmt* CreateMethodDeclStmt(int isStatic, enum AccessRule rule, struct Stmt* decl);

struct Stmt* CreateStmtListStmt(struct Stmt* stm);